package com.pikaqiu.warehouse.controller;

import com.pikaqiu.warehouse.domain.common.MiniAjaxResult;
import com.pikaqiu.warehouse.domain.dto.SpecialUserDto;
import com.pikaqiu.warehouse.domain.req.SpecialUserForm;
import com.pikaqiu.warehouse.service.SupplierService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: Administrator
 * @Date: 2024/8/16
 */
@RestController
@RequestMapping("/supplier")
public class SupplierController {

    @Resource
    private SupplierService supplierService;

    @GetMapping("/list")
    public MiniAjaxResult<List<SpecialUserDto>> listCompanySupplier() {
        return MiniAjaxResult.success(supplierService.listCompanySupplier());
    }

    @PostMapping("/save")
    public MiniAjaxResult<String> saveSupplier(SpecialUserForm specialUserForm) {
        supplierService.saveSupplier(specialUserForm);
        return MiniAjaxResult.success();
    }
}
